package org.me.timeWS;

import java.text.SimpleDateFormat;
import java.util.Calendar;
import java.util.Date;
import javax.jws.WebService;

@WebService()
public class givemethetime {

    public String getTime(){
        Date myDate = new Date();
        return  myDate.toString();
    }

    public String getMonth(){
        switch(Calendar.MONTH){
            case 0 : {return "January";}
            case 1 : {return "February";}
            case 2 : {return "March";}
            case 3 : {return "April";}
            case 4 : {return "May";}
            case 5 : {return "June";}
            case 6 : {return "July";}
            case 7 : {return "August";}
            case 8 : {return "September";}
            case 9 : {return "October";}
            case 10 : {return "November";}
            case 11 : {return "December";}
            default : {return "Never";}
        }
    }

    public String getDayOfTheWeek(){
        switch(SimpleDateFormat.DAY_OF_WEEK_FIELD){
            case 0 : {return "Monday";}
            case 1 : {return "Tuesday";}
            case 2 : {return "Wednesday";}
            case 3 : {return "Thursday";}
            case 4 : {return "Friday";}
            case 5 : {return "Saturday";}
            case 6 : {return "Sunday";}
            default : {return "Never";}
        }
    }

    public String getYear(){
        return ""+SimpleDateFormat.YEAR_FIELD;
    }

    public String getDayOfMonth(){
        return ""+SimpleDateFormat.DAY_OF_WEEK_IN_MONTH_FIELD;
    }
}
